<?php

	function smarty_block_voucher_types($params, $content, &$smarty, &$repeat)
    {
		global $db, $config;
		//var_dump(voucher_type::getVoucherTypeId(1));die;
		$l = count($smarty->_tag_stack);
		if(empty($params['name'])) $params['name'] = "voucher_types";

		if(empty($smarty->blockvars[$l]))
        {
			$smarty->blockvars[$l]=voucher_type::getAllVoucherType();
			if(!$smarty->blockvars[$l]) return $repeat = false;
			if(!empty($params['pager'])) $smarty->assign($params['pager'], $pager);
		}

		if(list($key, $item) = each($smarty->blockvars[$l])) {
			$repeat = true;
			$smarty->assign($params['name'], $item);
		}
		else
		{
			$repeat = false;
			reset($smarty->blockvars[$l]);
		}

		if(!is_null($content)) print $content;
		if(!$repeat) $smarty->blockvars[$l] = array();
	}
